<!--客户表单-->
<template>
  <div class="contain">
    <div class="mail-header displayflex">
      <div class="pic"><img src="~images/default/myfile_img.png"></div>
      <dl class="txt flex1">
        <dt>{{useritem.Name}}</dt>
        <dd>{{useritem.MobileNo}}</dd>
      </dl>
    </div>
    <div class="form-wrap mb30">
      <!-- <div class="form-wrap-row">
        <div class="line cf" @click="toDet">
          <div class="label f-l">设置角色和权限</div>
          <i class="iconfont icon-more f-r"></i>
        </div>
      </div> -->
      <!-- 选择以后的显示start -->
      <div class="form-wrap-row">
        <div class="line displayflex">
          <div class="label">角色分配</div>
          <span class="flex1 txt-rit gray">{{useritem.UserBizType | role}}</span>
          <!-- <i class="iconfont icon-more"></i> -->
        </div>
      </div>
      <!-- <div class="privi-detail displayflex">
        <span class="label">开通权限</span>
        <ul class="list flex1 cf">
          <li>审核</li>
          <li>通知配送</li>
        </ul>
      </div> -->
      <!-- 选择以后的显示end -->
    </div>
    <ul class="text-list">
      <li class="displayflex">
        <span class="l-txt flex1">账号</span> 
        <i class="r-txt">{{useritem.LogonUser}}</i>
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">所属部门</span> 
        <i class="r-txt">{{useritem.DeptName}}</i>
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">性别</span> 
        <i class="r-txt">{{useritem.Sex}}</i>
      </li>
      <li class="displayflex">
        <span class="l-txt flex1">微信号</span> 
        <i class="r-txt">{{useritem.WebChatOpentID}}</i>
      </li>
    </ul>
    <div class="form-btn" @click="edit">编辑</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      useritem:'',
    }
  },
  created() {
    // if(sessionStorage.item){
    //   this.useritem = JSON.parse(sessionStorage.item);;
    // };
    this.getData();
  },
  methods: {
    // toDet(){
    //   this.$router.push({
    //     path:'/mail/set'
    //   })
    // },
    edit(){
      this.$router.push({
        path:'/mail/add',
        query:{
          StaffID : this.$route.query.StaffID
        }
      })
    },
    getData() {
      var self = this;
      var userinfo = JSON.parse(localStorage.userinfo);
      var query = {
        TenantGUID: userinfo.TenantGUID,
        CorpGuid: userinfo.CorpGuid,
        StaffID: this.$route.query.StaffID
      };
      this.Ajax.post("SearchMfstaffbacies", query).then(function(resp) {
        if (resp.IsSuccess) {
          self.useritem = resp.Datas[0];
          var sex = self.useritem.Sex;
          if(sex == '1'){
            self.useritem.Sex = '男';
          }else if(sex == '2'){
            self.useritem.Sex = '女';
          };
        } else {
          self.Toast({
            message: resp.ErrorMessage || "操作失败，请稍后重试"
          });
        }
      });
    },
  }
}
</script>